Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle POIs in POIs during reverse lookup #3390

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

lonvia
Copy link
Member

@lonvia lonvia commented Apr 11, 2024

The closest object for reverse lookups is determined via the distance between query point and object. This automatically makes area POIs win when the lookup point is inside because then the distance is 0.

This PR tries to somewhat improve the situation by looking for the two closest objects and returning the second if the first is an area and the second is a POI node that is reasonably close.

There are some corner cases that this hack doesn't cover, for example when another street happens to be closer than the point POI. These cases are anyways tricky and probably better solved by returning multiple results. The generic case of a large POI area like a shopping mall should work better with this change.

See also #2785 and #3387.

@mtmail
Copy link
Collaborator

mtmail commented Apr 11, 2024

I can confirm this fixes the issue I saw in #3387

@lonvia lonvia merged commit 82970e2 into osm-search:master Apr 11, 2024
11 checks passed
@lonvia lonvia deleted the poi-in-poi branch April 11, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants